/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mopso;

/**
 *
 * @author robson
 */
public class MappedCells {
    private int[] lineGridMapped;
    private int nSolutionsInCell;
    private double fitnessDiversity;

    
    public void createLineGridMapped( int nDimensions ) {
        lineGridMapped = new int[nDimensions];
        
        for ( int i = 0; i < nDimensions; i++ ) {
            lineGridMapped[i] = -1;
        }
    }

    public int[] getLineGridMapped() {
        return lineGridMapped;
    }

    public void setLineGridMapped(int[] lineGridMapped) {
        this.lineGridMapped = lineGridMapped;
    }
    
    public boolean setLineGridMapped( int dimension, int value ) {
        
        if( dimension < lineGridMapped.length ) {
            this.lineGridMapped[dimension] = value;
            return true;
        }
        
        else {
            return false;
        }
    }

    public int getNSolutionsInCell() {
        return nSolutionsInCell;
    }

    public void setNSolutionsInCell(int nSolutionsInCell) {
        this.nSolutionsInCell = nSolutionsInCell;
    }
    
    public void incrementNSolutionsInCell( ) {
        nSolutionsInCell++;
    }

    public double getFitnessDiversity() {
        return fitnessDiversity;
    }

    public void setFitnessDiversity(double fitnessDiversity) {
        this.fitnessDiversity = fitnessDiversity;
    }
}
